package web.mails;

import domain.entities.Vendorcentral;
import web.CommonUtils;

import java.io.File;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: vgonzalez
 * Date: 13/11/12
 * Time: 16:30
 * To change this template use File | Settings | File Templates.
 */
public class VendorMails extends MailUtils {
    private static final String ADDRESS_FROM_VENDOR = "mail.probando@yahoo.com" ;
    private static final String PASS_FROM_VENDOR = "mailcandoit" ;
    private Vendorcentral vendorcentral;

    public VendorMails(Vendorcentral vendor){
        super(ADDRESS_FROM_VENDOR, PASS_FROM_VENDOR);
        this.vendorcentral = vendor;
    }

    public void sendMail(String textNvs, List<File> files, List<String> fileNames){
        String newLine = CommonUtils.getNewLineString();

        String mailSubject = new String("Vendor: " + vendorcentral.getName());

        String mailBody = new String("Name: " + vendorcentral.getName() + newLine);
        mailBody = mailBody + "Type: " + vendorcentral.getType().getDescripcion() + newLine;
        mailBody = mailBody + "Category: " + vendorcentral.getCategory() + newLine + newLine;

        if(textNvs != null)
            mailBody += textNvs;

        //TODO buscar destinatarios y mandar mail
        /*List<String> toAddresses =
        this.sendMail(mailSubject, mailBody, toAddresses, null, files, fileNames);*/

    }
}
